<extend name="Layout/base" />
<block name="css"><style>
	.el-main {
		padding: 20px;
	}
	.orderbox {
		padding: 20px;
		background: #fff;
		border: 1px solid #ccc;
	}
	.ordertop {
		display: flex;
		justify-content: space-between;
		font-size: 14px;
		padding-bottom: 15px;
		border-bottom: 1px solid #ccc;
	}
	.ordertop .title {
		height: 20px;
		line-height: 20px;
		display: flex;
		align-items: center;
	}
	.status {
		margin-left: 20px;
	}
	.status span {
		margin-left: 20px;
		display: inline-block;
		box-sizing: border-box;
		width: 50px;
		height: 25px;
		line-height: 25px;
		text-align: center;
	}
	.statusnow {
		border: 1px solid #ccc;
	}
	.accept {
		border: 1px solid #ccc;
		border-radius: 6px;
		padding: 5px;
	}
	.orderdetail {
		padding: 20px 0;
		display: flex;
		margin-top: 20px;
		border-bottom: 1px solid #ccc;
	}
	.workerinfo {
		width: 50%;
		display: flex;
	}
	.infotitle {
		font-size: 20px;
		white-space: nowrap;
	}
	.baseinfo {
		display: flex;
		align-items: center;
	}
	.baseinfo p {
		margin-top: 5px;
	}
	.baseinfo p span {
		margin-left: 20px;
		/*white-space: nowrap;*/
	}
	.workerinfo .img img {
		width: 100px;
		height: 100px;
		border-radius: 50%;
		margin-left: 20px;
	}
	.jobinfo {
		display: flex;
		padding: 20px 0;
		border-bottom: 1px solid #ccc;
	}
	.otherinfo {
		display: flex;
		padding-top: 20px;
	}
	.other {
		padding: 20px 0;
		margin-top: 20px;
		background: #fff;
	}
	.table {
		border: 1px solid #ccc;
	}
	.el-tabs__item {
		font-size: 22px;
	}
	.el-input--suffix {
		width: 200px;
		margin-right: 20px;
	}
	.select {
		text-align: right;
		margin-bottom: 10px;
	}
</style></block>
<block name="content">
	<div class="orderbox">
		<div class="ordertop">
			<div class="title">
				<span style="color:#55a8fe;font-weight: bold;">师傅资料</span>
				<div class="status">状态：<span :class="statusnow == 1 ? 'statusnow' : '' " @click="statusnow = 1">启用</span><span :class="statusnow == 2 ? 'statusnow' : '' " @click="statusnow = 2">停用</span></div>
			</div>
		</div>
		<div class="orderdetail">
			<div class="workerinfo">
				<div class="infotitle">基础信息</div>
				<div class="baseinfo">
					<div class="img"><img src="__PUBLIC__/orderAdmin/img/logo.png" alt=""></div>
					<div>
						<p><span>用户姓名</span><span style="margin-left:30px;">{$info['name']}</span></p>
						<p><span>用户手机</span><span style="margin-left:30px;">{$info['mobile']}</span></p>
						<p><span>所属城市</span><span style="margin-left:30px;">{$info['city']}</span></p>
						<p><span>身份证号</span><span>{$info['certid']}</span></p>
						<p><span>服务范围</span><span>{$info['area']}</span></p>
					</div>
				</div>
			</div>
		</div>
		<div class="jobinfo">
			<div class="workerinfo">
				<div class="infotitle">任务信息</div>
				<div class="baseinfo">
					<div>
						<p><span>注册时间：</span><span>{:format_date($info['add_time'])}</span></p>
						<p><span>完成任务：</span><span>30</span></p>
						<p><span>累计金额：</span><span>18990</span></p>
						<p><span>剩余金额：</span><span>2648</span></p>
						<p><span>银行账号：</span><span></span></p>
						<p><span>微信账号</span><span></span></p>
					</div>
				</div>
			</div>
			<div class="workerinfo">
				<div class="infotitle">个人资料</div>
				<div class="baseinfo">
					<div>
						<p><span>性别：</span><span>{:sex2Str($info['sex'])}</span></p>
						<p><span>年龄：</span><span>{$info['age']}</span></p>
						<p><span>专长：</span><span>{:specialty2Str($info['specialty'])}</span></p>
					</div>
				</div>
			</div>
		</div>
		<div class="otherinfo">
			<div class="infotitle">其他信息</div>
			<div style="margin-left: 30px;">
				<p><span style="display:inline-block;width: 90px;">所属合伙人： </span></p>
				<p  style="margin-left: 90px;margin-top: 10px;">{$info['partner_name']}</p>
			</div>
		</div>
	</div>
	<div class="other">
		<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
			<el-tab-pane label="任务详情" name="stuff">
				<div class="select">
					<el-select size="small" v-model="param.worker_order_status">
						<el-option label="待领物料" value="1"> </el-option>
						<el-option label="待施工" value="2"> </el-option>
						<el-option label="上画进行中" value="3"> </el-option>
						<el-option label="上画待验收" value="4"> </el-option>
						<el-option label="上画验收成功" value="5"> </el-option>
						<el-option label="下画进行中" value="6"> </el-option>
						<el-option label="下画待验收" value="7"> </el-option>
						<el-option label="下画验收完成" value="8"> </el-option>
						<el-option label="已完成" value="9"> </el-option>
					</el-select>
					<el-input size="small" placeholder="请输入内容" v-model="param.key">
						<i slot="suffix" class="el-input__icon el-icon-search"></i>
					</el-input>
				</div>
				<div class="table">
					<el-table :data="tableData" height="250" style="width: 100%" :cell-style= "{ 'text-align': 'center'}" :header-cell-style="{ 'text-align':'center'}">
						<el-table-column prop="order_no" label="订单号"></el-table-column>
						<el-table-column prop="store_name" label="公司简称"></el-table-column>
						<el-table-column prop="audit_name" label="审核员"></el-table-column>
						<el-table-column prop="activity_name" label="活动名称"></el-table-column>
						<el-table-column prop="manager_name" label="客戶"></el-table-column>
						<el-table-column  label="状态">
							<template slot-scope="scope">
								<span v-if="scope.row.worker_order_status == 1">待领物料</span>
								<span v-if="scope.row.worker_order_status == 2">待施工</span>
								<span v-if="scope.row.worker_order_status == 3">上画进行中</span>
								<span v-if="scope.row.worker_order_status == 4">上画待验收</span>
								<span v-if="scope.row.worker_order_status == 5">上画验收成功</span>
								<span v-if="scope.row.worker_order_status == 6">下画进行中</span>
								<span v-if="scope.row.worker_order_status == 7">下画待验收</span>
								<span v-if="scope.row.worker_order_status == 8">下画验收完成</span>
								<span v-if="scope.row.worker_order_status == 9">已完成</span>
							</template>
						</el-table-column>
						<el-table-column prop="" label="项目负责人"></el-table-column>
						<el-table-column prop="partner_name" label="城市合伙人"></el-table-column>
						<el-table-column prop="option" label="操作">
							<template slot-scope="scope">
								<span style="border: 1px solid #ccc;color: #409EFF;padding:0px 10px;border-radius: 3px;display: inline-block;" @click="toDetail(scope.row.order_no)">查看</span>
							</template>
						</el-table-column>
					</el-table>
				</div>
			</el-tab-pane>
			<el-tab-pane label="钱包情况" name="order">
				钱包详情内容部分
			</el-tab-pane>
			<el-tab-pane label="体现详情" name="advertise">
				体现详情内容
			</el-tab-pane>
		</el-tabs>
	</div>
</block>
<block name="js">
	<script>
        new Vue({
            el: '#app',
            data: function() {
                return {
                    workerid: "",
                    statusnow: 1, // 启用 or 停用
                    activeName: "stuff",
                    status: "",
                    searchinput: "",
                    form: {
                        region: "物料统一配送",
                        topname: "",
                        topnum: "",
                        lessname: "",
                        lessnum: ""
                    },
					param: {
                        key: '',
                        worker_order_status: '',
						worker_id: '{$info["id"]}',
						page: 1,
						size: 10
					},
                    tableData: [
                        {
                            orderno: '201904102145',
                            name: '哈根达斯',
                            checker: "啊啊啊",
                            activity: "节日促销",
                            client: "海岸城店",
                            partner: "马克思",
                            status: "进行中",
                            charger: "哈哈哈哈",
                            option: "查看"
                        },
                        {
                            orderno: '201904102146',
                            name: '哈根达斯',
                            checker: "啊啊啊",
                            activity: "节日促销",
                            client: "海岸城店",
                            partner: "马克思",
                            status: "进行中",
                            charger: "哈哈哈哈",
                            option: "查看"
                        },
                        {
                            orderno: '201904102147',
                            name: '哈根达斯',
                            checker: "啊啊啊",
                            activity: "节日促销",
                            client: "海岸城店",
                            partner: "马克思",
                            status: "进行中",
                            charger: "哈哈哈哈",
                            option: "查看"
                        },
                        {
                            orderno: '201904102148',
                            name: '哈根达斯',
                            checker: "啊啊啊",
                            activity: "节日促销",
                            client: "海岸城店",
                            partner: "马克思",
                            status: "进行中",
                            charger: "哈哈哈哈",
                            option: "查看"
                        },
                        {
                            orderno: '201904102149',
                            name: '哈根达斯',
                            checker: "啊啊啊",
                            activity: "节日促销",
                            client: "海岸城店",
                            partner: "马克思",
                            status: "进行中",
                            charger: "哈哈哈哈",
                            option: "查看"
                        },
                        {
                            orderno: '201904102145',
                            name: '哈根达斯',
                            checker: "啊啊啊",
                            activity: "节日促销",
                            client: "海岸城店",
                            partner: "马克思",
                            status: "进行中",
                            charger: "哈哈哈哈",
                            option: "查看"
                        },
                        {
                            orderno: '201904102145',
                            name: '哈根达斯',
                            checker: "啊啊啊",
                            activity: "节日促销",
                            client: "海岸城店",
                            partner: "马克思",
                            status: "进行中",
                            charger: "哈哈哈哈",
                            option: "查看"
                        }
                    ]
                }
            },
			created: function () {
				this.getData();
            },
            methods: {
                getData: function () {
					var _this = this;
					$.post(HOME_URL + "/orderAdmin/Order/getData", _this.param, function (data) {

                        if(data.status){
                            _this.total = parseInt(data.data.count);
                            _this.tableData = data.data.data;
                        }else{
                            _this.$message.error(data.msg);
                        }
                    }, 'json');
                },
                handleClick(tab, event) {
                    console.log(tab, event);
                },
                toDetail(order_no) {
                    window.location.href = HOME_URL + "/orderAdmin/Order/detail?order_no=" + order_no
                }
            }
        });
	</script>
</block>
